using System;
using Common.Enumerations;
using Newtonsoft.Json;
using PetaPoco;
using Sanelib.DataView;

namespace Common.Views
{
	[TableName("AssignedContactView")]
	public class AssignedContactView : AuditedView
	{
		public Guid ContactId { get; set; }
	    public string ContactName { get; set; }
	    public string Mobile { get;  set; }
	    public string Email { get; set; }
	    public string CompanyName { get; set; }

	    [JsonIgnore]
	    public Designation Designation { get; set; }
        public string DesignationValue { get { return Designation == null ? "" : Designation.Value; } set { Designation = Designation.FromValue(value); } }
        public string DesignationName { get { return Designation == null ? "" : Designation.DisplayName; } set { Designation = Designation.FromDisplay(value); } }

	    [JsonIgnore]
        public EntityType EntityType { get; set; }
        public string EntityTypeValue { get { return EntityType == null ? "" : EntityType.Value; } set { EntityType = EntityType.FromValue(value); } }
        public string EntityTypeName { get { return EntityType == null ? "" : EntityType.DisplayName; } set { EntityType = EntityType.FromDisplay(value); } }
        public Guid ReferenceId { get; set; }
        public string ReferenceName { get; set; }
	}
}
